<style>
table, tr, td {border: none; border-collapse: collapse; text-align: center;}
.th {
     padding: 7px;
     text-align: center;
     background-color: #999 !important;
     color: #fff !important;
     line-height:12px;
     border: 1px solid white;
   }
#body {
	margin:auto;
}
.input {
	border: none;
}
</style>
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <div class="form-group">
        <label class="control-label col-xs-5 col-sm-2">生产工厂:</label>
        <div class="col-xs-5 col-sm-3">
            <input id="c-factory_id" data-rule="required" data-source="clothbank/index" data-params={"custom[sort]":"1"} class="form-control selectpage" name="row[factory_id]" type="text" value="">
        </div>
        <label class="control-label col-xs-5 col-sm-2">生产单号:</label>
        <div class="col-xs-5 col-sm-3">
            <input id="c-sn" data-rule="required" class="form-control" name="row[sn]" type="text" value="{$produceSn}" readonly>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">采购单据凭证:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-images" class="form-control" size="50" name="row[images]" type="hidden" value="{$purchase_certs|htmlentities}" disabled>
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-images" class="btn btn-danger faupload" data-input-id="c-images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="true" data-preview-id="p-images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span style="display:none;"><button type="button" id="fachoose-images" class="btn btn-primary fachoose" data-input-id="c-images" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-images"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-images"></ul>
        </div>
    </div>
    
    <div class="form-group row" style="text-align:center;">
           <dl class="fieldlist" data-template="billtpl" data-name="row[bill]" style="margin-left: -16px;" id="bill">
               <dd class="th" style="margin-left: -80px;">
                   <ins>{:__('生产款号')}</ins>
                   <ins>{:__('布行')}</ins>
                   <ins>{:__('颜色')}</ins>
                   <ins>{:__('布匹批次')}</ins>
                   <ins>{:__('面料总数')}</ins>
                   <ins>{:__('安排数量')}</ins>
               </dd>
               <hr>
               <dd style="display: none;"><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
               <!--请注意 dd和textarea间不能存在其它任何元素，实际开发中textarea应该添加个hidden进行隐藏-->
               <textarea name="row[bill]" class="form-control" cols="30" rows="5" style="display: none;">{$jsonBill}</textarea>
           </dl>
           <script id="billtpl" type="text/html">
              <dd class="form-inline" style="text-align:center;">
                <ins><input name="<%=name%>[<%=index%>][clothtype_id]" class="form-control selectpage" type="text" data-rule="required" value="" data-source="clothtype" data-field="No"></ins>
                <ins><input name="<%=name%>[<%=index%>][clothbank_id]" class="form-control selectpage" type="text" data-rule="required" value="<%=row.purchase.clothbank_id%>" data-source="clothbank" disabled></ins>
                <ins><input name="<%=name%>[<%=index%>][color]" class="form-control" type="text" data-rule="required" value="<%=row.color%>" readonly></ins>
				<ins style="width: 140px;"><input name="<%=name%>[<%=index%>][purchase_sn]" class="form-control" type="number" value="<%=row.purchase.sn%>" style="width: 140px;" readonly></ins>
				<ins><input name="<%=name%>[<%=index%>][used_nums]" class="form-control" type="number" value=""></ins>
				<ins><input name="<%=name%>[<%=index%>][produce_ratio]" class="form-control" type="text"></ins>
				<input name="<%=name%>[<%=index%>][purchase_id]" class="form-control" type="hidden" value="<%=row.purchase.id%>">
				<input name="<%=name%>[<%=index%>][bill_id]" class="form-control" type="hidden" value="<%=row.id%>">
                <!--下面的两个按钮务必保留-->
                <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
                <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
              </dd>
           </script>      
    </div>
    
    
    
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">生产安排:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-remark" class="form-control" rows="3" name="row[remark]" cols="50"></textarea>
        </div>
    </div>  
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
        </div>
    </div>
</form>
